/** testconvert.d: The unit test for dotmars/base/convert.d

  Written in the D programming language 1.0

Authors:	Wei Li (oldrev@gmail.com)
Copyright:	Copyright (C) 2007 by Wei Li.
License:	BSD
*/

module test.base.testconvert;

import dotmars.base.convert;
import dotmars.test.core;

class BitConverterTestCase : TestCase!(BitConverterTestCase)
{

	this()
	{
		register("testByteOrder", &testByteOrder);
	}

	void testByteOrder() 
	{
		ushort a, b;
		a = 0x00FF;
		b = BitConverter.reverseByteOrder(a);
		assertTrue(b == 0xFF00);
	}
}

class IntegerTestCase : TestCase!(IntegerTestCase)
{
	this()
	{
		super(["testConverting": &testConverting]);
	}

	void testConverting()
	{
		assertTrue(Integer.toString!(int)(12) == "12");
		assertTrue(Integer.toString!(int)(15, 16) == "F");
		assertTrue(Integer.toString!(int)(15, 10, 4) == "0015");
	}
}


class FloatTestCase : TestCase!(FloatTestCase)
{
	this()
	{
		super(["testConverting": &testConverting]);
	}

	void testConverting()
	{
	}
}


class ConvertTestCase : TestCase!(ConvertTestCase)
{
	this()
	{
		super(["testConverting": &testConverting]);
	}

	void testConverting()
	{
	}
}


class FormatterTestCase : TestCase!(FormatterTestCase)
{
	this()
	{
		super(["testFormatting": &testFormatting]);
	}

	void testFormatting()
	{
	}
}

